﻿
function CheckCharacters(e) {
    var keynum;
    var keychar;
    var charcheck;
    if (window.event) // IE
        keynum = e.keyCode;

    else if (e.which) // Netscape/Firefox/Opera
        keynum = e.which;
    keychar = String.fromCharCode(keynum);
    if (keynum == "8") { }
    else {
        charcheck = /[a-zA-Z ]/;
        return charcheck.test(keychar);
    }
}
function keyRestrict2(e, validchars, casesensitives, onceevery, onceoneof) {
    validchars += '\\"'; onceevery = onceevery ? onceevery : ""; onceoneof = onceoneof ? onceoneof : ""; if (!validchars)
        return true; var key = '', keychar = '', obj = '', i = 0; var ua = $.browser; var key; if (ua.msie) { key = e.which ? e.which : window.event.keyCode; }
    else { key = e.which ? e.which : e.keyCode; }
    var obj = e.target ? e.target : window.event.srcElement; if (key == null)
        return true; keychar = String.fromCharCode(key); validchars = (validchars + onceevery + onceoneof); if (!casesensitives) { keychar = keychar.toLowerCase(); validchars = validchars.toLowerCase(); onceevery = onceevery.toLowerCase(); onceoneof = onceoneof.toLowerCase(); }
    for (i = 0; i < (onceevery + onceoneof).length; i++) {
        if (i < onceevery.length) {
            if (obj.value.indexOf(onceevery.charAt(i)) != -1 && keychar == onceevery.charAt(i))
                return false;
        }
        else {
            if (obj.value.indexOf(onceoneof.charAt(i - onceevery.length)) != -1 && onceoneof.indexOf(keychar) != -1)
                return false;
        }
    }
    if (validchars.indexOf(keychar) != -1)
        return true; if (key == null || key == 0 || key == 8 || key == 9 || key == 27 || key == 13 || key == 37 || key == 38 || key == 39 || key == 40)
        return true; return false;
}
function ClearForm() {
    $('[id$="txt_SName"]').val("");
    $('[id$="txt_PrefName"]').val("");
    $('[id$="txt_DOB"]').val("");
    $('[id$="ddl_Gender"]').val("");
    $('[id$="ddl_Nationality"]').val("");
    $('[id$="ddl_Grade"]').val("");
    $('[id$="txt_InchrgeTeacher"]').val("");
    $('[id$="txt_Address"]').val("");
    $('[id$="txt_HPhone"]').val("");
    $('[id$="txt_CPhone"]').val("");
    $('[id$="txt_Fax"]').val("");
    $('[id$="txt_Email"]').val("");
    $('[id$="txt_City"]').val("");
    $('[id$="txt_State"]').val("");
    $('[id$="txt_Zip"]').val("");
    $('[id$="txt_Country"]').val("");

}
function EnrollStudent() { 
if(){}
else{

}
}